package com.qf.spring.service;

import com.qf.spring.dao.UserDao;
import com.qf.spring.pojo.User;

/**
 * @author 王博康
 * @version 1.0
 * @project 01_spring
 * @description: TODO
 * @date 2022/3/3 16:13 星期四
 */
public class UserService {
    //声明依赖
    private UserDao userDao;
    //提供设置依赖的方法
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
    //调用依赖
    public void addUser(){
        userDao.addUser();
        System.err.println("UserService类的addUser方法执行了...");
    }
    //调用依赖
    public User getUser() {
        return userDao.getUser();
    }
}
